Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 2 - Providers / Providers Reference
Functions / Controlling a Provider's Mode of Operation


OTSetNonBlocking

Does not allow a provider to wait if it cannot currently complete a function that sends or receives data.

C INTERFACE
OSStatus OTSetNonBlocking(ProviderRef ref);
C++ INTERFACE
OSStatus TProvider::SetNonBlocking();
PARAMETERS
ref
The provider reference of the provider whose blocking mode is being set.
DESCRIPTION
The OTSetNonBlocking function causes provider functions to return a result code immediately, instead of waiting for a function that sends or receives data to complete. When you open a provider, its mode of operation is set to nonblocking by default.

If a provider is in nonblocking mode and you call the OTCloseProvider function, the provider flushes all outgoing commands in the stream and immediately close the provider. Conversely, in blocking mode, the provider would give each Streams module up to 15 seconds to flush outgoing commands. It is recommended that you call the OTSetNonblocking function before you call the OTCloseProvider function.

SEE ALSO
Blocking is described in "Setting a Provider's Blocking Status" on page 2-10.

To set a provider's blocking status to blocking, call the OTSetBlocking function, (page 2-32). To find out a provider's blocking status, call the OTIsNonBlocking function (page 2-35).

Blocking attributes affect endpoint providers more than other providers. For more information, see the discussion about modes of operation in the chapter "Endpoints" in this book.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996